[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+-------------+############################################################
#+-| GOTO BOTTOM |------------------------------------------+#################
#| +-------------+ GOTO BOTTOM or GOTO TOP sets the record |#################
#| number to the last or first logical |#################
#| record in the current or selected alias. |#################
#+----------------------------------------------------------+#################
##############################################################################
##############################################################################
#+--| Syntax |-------------------------------+################################
#| [!<Alias>] GOTO <TOP> || <BOTTOM> |################################
#| [!<Alias>] GO <TOP> || <BOTTOM> |################################
#+-------------------------------------------+################################
##############################################################################
##############################################################################
########+---| Description |------------------------------------------+########
########| GOTO TOP and GOTO BOTTOM respect the status of the current |########
########| index file, filters or the deleted flag. To get to the |########
########| first or last record in the alias, use GOTO. |########
########+------------------------------------------------------------+########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * The OPEN and USE command position the record |#########
#########| * pointer at the first logical record in the |#########
#########| * database. GOTO BOTTOM must be programmed to |#########
#########| * get to the last record after an OPEN or USE. |#########
#########| |#########
#########| USE "pblctns.dbf" ALIAS magazines |#########
#########| GOTO BOTTOM |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Verify that the lasy physical record is in |#########
#########| * an index file. |#########
#########| |#########
#########| USE "test.dbf" ALIAS test |#########
#########| GOTO BOTTOM |#########
#########| k = test->field |#########
#########| SET INDEX TO itest |#########
#########| SEEK k |#########
#########| IF .NOT. found() |#########
#########| {...} |#########
#########| ENDIF |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 3 |-------------------------------------------+#########
#########| * If a database is indexed, the TOP or BOTTOM |#########
#########| * record is considered the first or last |#########
#########| * logical record. |#########
#########| |#########
#########| OPEN "dbf.dbf" ALIAS dbf_w_index INDEX dbf_index |#########
#########| |#########
#########| !dbf_w_index GOTO TOP && Positions record pointer |#########
#########| && at the record indicated |#########
#########| && by the index file. This |#########
#########| && is not necessarily |#########
#########| && record 1. |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 4 |-------------------------------------------+#########
#########| * If the first record is deleted, GOTO TOP |#########
#########| * will position the record pointer at |#########
#########| * record 1 if the SET DELETE flag is OFF. |#########
#########| |#########
#########| OPEN "deleted.dbf" alias gone |#########
#########| GOTO TOP && We are at record 1. |#########
#########| DELETE && Record 1 has been |#########
#########| |#########
#########| |#########
#########| SET DELETE ON && We are at record 2. |#########
#########| GOTO TOP |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
DELETE
GOTO
GOTO TOP
INDEX
SET FILTER TO
SET INDEX TO
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson